import 'package:flutter/material.dart';
import 'json.dart';
void main()=>runApp(MyApp());

class MyApp extends StatelessWidget{
  List<Widget> _getData(){
    var json = DataList.map((v){
      return ListTile(
        title: Text(v['title']),
      );
    });
    // List<Widget> list = new List();
    // for(var i=0;i<20;i++){
    //   list.add(ListTile(
    //     title:Text("第$i 条信息")
    //   ));
    // }
    return json.toList();
}
  Widget build(BuildContext context){
    return MaterialApp(
      home:Scaffold(
        appBar: AppBar(
          title: Text("data",
          textAlign: TextAlign.right,
          ),
        ),
        body: ListView.builder(
          itemCount: DataList.length,
          itemBuilder: (context,index){
            return ListTile(
              title: Text("data${DataList[index]['title']}"),
            );
          },
        ),
      ),
    );
  }
}


